package com.caocaog.market.controller;

import com.caocaog.market.annotation.IgnoreAuth;
import com.caocaog.market.entity.Member;
import com.caocaog.market.service.MemberService;
import com.caocaog.market.vo.WxPhoneVO;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.jeecg.common.api.vo.Result;
import org.jeecg.common.util.oConvertUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@Slf4j
@RestController
@RequiredArgsConstructor
@Api(value = "memberApi", tags = "API-sdx用户")
@RequestMapping("/api/member/sdx")
public class ApiSDXMemberController {

    @Autowired
    private MemberService memberService;


    @IgnoreAuth
    @ApiOperation(value = "同步送大侠用户",response = Member.class)
    @PostMapping("/syncSDXMember")
    public Result syncSDXMember(@RequestBody Member member) {
        if ( oConvertUtils.isEmpty(member.getMobile())
        || oConvertUtils.isEmpty(member.getWxUnionid())){
            return Result.error("参数错误");
        }
        return memberService.syncSDXMember(member);
    }



}
